<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1"><title>添加 Cherry 樱花雨背景特效 | Cyan</title><meta name="author" content="Cyan,843348394@qq.com"><meta name="copyright" content="Cyan"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="樱花雨 Cherry 背景特效 新建 [Blogroot]\themes\butterfly\source\css\custom\index.css, 添加 Canvas 默认样式。 12345678910.cherry-container &amp;#123;  position: fixed;  width: 100%;  height: 100vh;  margin: 0;  padding: 0;"><meta property="og:type" content="article"><meta property="og:title" content="添加 Cherry 樱花雨背景特效"><meta property="og:url" content="https://xmwpro.com/post/736f6468.html"><meta property="og:site_name" content="Cyan"><meta property="og:description" content="樱花雨 Cherry 背景特效 新建 [Blogroot]\themes\butterfly\source\css\custom\index.css, 添加 Canvas 默认样式。 12345678910.cherry-container &amp;#123;  position: fixed;  width: 100%;  height: 100vh;  margin: 0;  padding: 0;"><meta property="og:locale" content="zh_CN"><meta property="og:image" content="https://ali-oss.xmwpro.com/global/avatar.jpg"><meta property="article:published_time" content="2022-04-25T14:53:15.000Z"><meta property="article:modified_time" content="2023-06-26T09:26:36.564Z"><meta property="article:author" content="Cyan"><meta property="article:tag" content="ButterFly"><meta property="article:tag" content="Hexo"><meta name="twitter:card" content="summary"><meta name="twitter:image" content="https://ali-oss.xmwpro.com/global/avatar.jpg"><link rel="shortcut icon" href="https://ali-oss.xmwpro.com/global/favicon.ico"><link rel="canonical" href="https://xmwpro.com/post/736f6468.html"><link rel="preconnect" href="//cdn.jsdelivr.net"><link rel="preconnect" href="//www.google-analytics.com" crossorigin=""><link rel="preconnect" href="//hm.baidu.com"><meta name="baidu-site-verification" content="codeva-yHszJZWbvj"><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/all.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/snackbar.min.css" media="print" onload='this.media="all"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/fancybox.css" media="print" onload='this.media="all"'><script>var _hmt=_hmt||[];!function(){var e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?81fae81fdc8992b3e6ca314f289131e8";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}()</script><script async src="https://www.googletagmanager.com/gtag/js?id=G-2P0LMHZNDD"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-2P0LMHZNDD")</script><script>const GLOBAL_CONFIG={root:"/",algolia:{appId:"2Q4I5JDAJR",apiKey:"2ec9f676fd9c568eb0abedad38d16fe6",indexName:"Hexo",hits:{per_page:6},languages:{input_placeholder:"输入关键词快速查找",hits_empty:"找不到您查询的内容：${query}",hits_stats:"找到 ${hits} 条结果，用时 ${time} 毫秒"}},localSearch:void 0,translate:{defaultEncoding:2,translateDelay:0,msgToTraditionalChinese:"繁",msgToSimplifiedChinese:"簡"},noticeOutdate:void 0,highlight:{plugin:"highlighjs",highlightCopy:!0,highlightLang:!0,highlightHeightLimit:200},copy:{success:"复制成功",error:"复制错误",noSupport:"浏览器不支持"},relativeDate:{homepage:!1,post:!1},runtime:"天",date_suffix:{just:"刚刚",min:"分钟前",hour:"小时前",day:"天前",month:"个月前"},copyright:{limitCount:50,languages:{author:"作者: Cyan",link:"链接: ",source:"来源: Cyan",info:"著作权归作者所有。商业转载请联系作者获得授权，非商业转载请注明出处。"}},lightbox:"fancybox",Snackbar:{chs_to_cht:"你已切换为繁体",cht_to_chs:"你已切换为简体",day_to_night:"你已切换为深色模式",night_to_day:"你已切换为浅色模式",bgLight:"var(--cyan-theme-color)",bgDark:"var(--cyan-theme-color)",position:"top-center"},source:{justifiedGallery:{js:"https://ali-oss.xmwpro.com/cdn/js/fjGallery.min.js",css:"https://ali-oss.xmwpro.com/cdn/css/fjGallery.css"}},isPhotoFigcaption:!0,islazyload:!0,isAnchor:!1,percent:{toc:!1,rightside:!0}}</script><script id="config-diff">var GLOBAL_CONFIG_SITE={title:"添加 Cherry 樱花雨背景特效",isPost:!0,isHome:!1,isHighlightShrink:!1,isToc:!0,postUpdate:"2023-06-26 09:26:36"}</script><noscript><style>#nav{opacity:1}.justified-gallery img{opacity:1}#post-meta time,#recent-posts time{display:inline!important}</style></noscript><script>(e=>{e.saveToLocal={set:function(e,t,o){if(0===o)return;const n=864e5*o,a={value:t,expiry:(new Date).getTime()+n};localStorage.setItem(e,JSON.stringify(a))},get:function(e){const t=localStorage.getItem(e);if(!t)return;const o=JSON.parse(t);if(!((new Date).getTime()>o.expiry))return o.value;localStorage.removeItem(e)}},e.getScript=e=>new Promise(((t,o)=>{const n=document.createElement("script");n.src=e,n.async=!0,n.onerror=o,n.onload=n.onreadystatechange=function(){const e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(n.onload=n.onreadystatechange=null,t())},document.head.appendChild(n)})),e.getCSS=e=>new Promise(((t,o)=>{const n=document.createElement("link");n.rel="stylesheet",n.href=e,n.onload=()=>t(),n.onerror=()=>o(),document.head.appendChild(n)})),e.activateDarkMode=function(){document.documentElement.setAttribute("data-theme","dark"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#0d0d0d")},e.activateLightMode=function(){document.documentElement.setAttribute("data-theme","light"),null!==document.querySelector('meta[name="theme-color"]')&&document.querySelector('meta[name="theme-color"]').setAttribute("content","#ffffff")};const t=saveToLocal.get("theme"),o=(new Date).getHours();void 0===t?o<=6||o>=18?activateDarkMode():activateLightMode():"light"===t?activateLightMode():activateDarkMode();const n=saveToLocal.get("aside-status");void 0!==n&&("hide"===n?document.documentElement.classList.add("hide-aside"):document.documentElement.classList.remove("hide-aside"));/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)&&document.documentElement.classList.add("apple")})(window)</script><link rel="stylesheet" href="//at.alicdn.com/t/c/font_3348168_pqjhlyxfz9r.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/swiper-bundle.min.css"><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/tianli_gpt.css"><script src="https://ali-oss.xmwpro.com/cdn/js/swiper-bundle.min.js"></script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/jquery-3.3.1.js"></script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/echarts.min.js"></script><script charset="UTF-8" id="LA_COLLECT" src="https://sdk.51.la/js-sdk-pro.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/three.min.js"></script><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/font-awesome-animation.min.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/tag_plugins.css" media="defer" onload='this.media="all"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/animate.min.css" media="print" onload='this.media="screen"'><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/gitcalendar.css" media="print" onload='this.media="all"'><meta name="generator" content="Hexo 5.4.2"><link rel="alternate" href="/atom.xml" title="Cyan" type="application/atom+xml"></head><body><div id="loading-box" onclick="document.getElementById(&quot;loading-box&quot;).classList.add(&quot;loaded&quot;)"><div class="loading-bg"><div class="loading-img"></div><div class="loading-image-dot"></div></div></div><script>const preloader={endLoading:()=>{document.body.style.overflow="auto",document.getElementById("loading-box").classList.add("loaded")},initLoading:()=>{document.body.style.overflow="",document.getElementById("loading-box").classList.remove("loaded")}};window.addEventListener("load",(()=>{preloader.endLoading()})),document.addEventListener("pjax:send",(()=>{preloader.initLoading()})),document.addEventListener("pjax:complete",(()=>{preloader.endLoading()}))</script><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/progress_bar.css"><script src="https://ali-oss.xmwpro.com/cdn/js/pace.min.js"></script><div id="web_bg"></div><div id="music_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/avatar.jpg" onerror='onerror=null,src="/img/friend_404.gif"' alt="avatar"></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">48</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">23</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div><hr><div class="menus_items"><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fas fa-book"></i> <span>文库</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/archives/"><i class="fa-fw faa-tada fa-solid fa-box-archive"></i> <span>全部文章</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/tags/"><i class="fa-fw faa-tada fas fa-tags"></i> <span>标签</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/categories/"><i class="fa-fw faa-tada fas fa-shapes"></i> <span>分类</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fab fa-artstation"></i> <span>社交</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/link/"><i class="fa-fw faa-tada fa-solid fa-link"></i> <span>友人帐</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/fcircle/"><i class="fa-fw faa-tada fa-solid fa-user-group"></i> <span>朋友圈</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/guestbook/"><i class="fa-fw faa-tada fa-solid fa-envelope"></i> <span>留言板</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fas fa-coffee"></i> <span>休闲</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/music/"><i class="fa-fw faa-tada fa-solid fa-music"></i> <span>音乐馆</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/photoAlbum/"><i class="fa-fw faa-tada fa-solid fa-camera"></i> <span>相册</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/essay/"><i class="fa-fw faa-tada fa-solid fa-message"></i> <span>哔哔</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fa-solid fa-earth-asia"></i> <span>本站</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/analysis/"><i class="fa-fw faa-tada fa-solid fa-chart-simple"></i> <span>博客统计</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/about/"><i class="fa-fw faa-tada fa-regular fa-address-card"></i> <span>关于我</span></a></li></ul></div></div></div></div><div class="canvas-container" id="canvas"></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image:url('https://ali-oss.xmwpro.com/posts/post_cover44.jpg')"><nav id="nav"><span id="blog-info"><div class="back-home-button" tabindex="-1"><i class="back-home-button-icon fas fa-grip-vertical"></i><div class="back-menu-list-groups"><div class="back-menu-list-group"><div class="back-menu-list-title">社交</div><div class="back-menu-list"><a class="back-menu-item" href="https://xmwpro.com/" title="白雾茫茫丶" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/global/avatar.jpg"><span class="back-menu-item-text">白雾茫茫丶</span></a><a class="back-menu-item" href="https://github.com/Cyan-Xmw/" rel="external nofollow noreferrer" title="Github" target="_blank" one-link-mark="yes"><i class="iconfont cyan-gitHub"></i><span class="back-menu-item-text">Github</span></a><a class="back-menu-item" href="https://gitee.com/Cyan-Xmw/" rel="external nofollow noreferrer" title="Gitee" target="_blank" one-link-mark="yes"><i class="iconfont cyan-gitee"></i><span class="back-menu-item-text">Gitee</span></a><a class="back-menu-item" href="https://juejin.cn/user/1917147257534279/" rel="external nofollow noreferrer" title="掘金" target="_blank" one-link-mark="yes"><i class="iconfont cyan-juejin"></i><span class="back-menu-item-text">掘金</span></a></div></div><div class="back-menu-list-group"><div class="back-menu-list-title">项目</div><div class="back-menu-list"><a class="back-menu-item" href="https://docs.xmwpro.com/" rel="external nofollow noreferrer" title="Cyan Docs" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/project/xmw-dumi-docs/logo.svg"><span class="back-menu-item-text">Cyan Docs</span></a><a class="back-menu-item" href="http://react.xmwpro.com/" rel="external nofollow noreferrer" title="Xmw-Admin" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/pages/resource/xmw-admin.svg"><span class="back-menu-item-text">Xmw-Admin</span></a><a class="back-menu-item" href="http://vue3.xmwpro.com/" rel="external nofollow noreferrer" title="Vue3-Admin" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/project/vue3-admin/logo.png"><span class="back-menu-item-text">Vue3-Admin</span></a><a class="back-menu-item" href="http://vue2.xmwpro.com/" rel="external nofollow noreferrer" title="Vue2-Admin" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/project/vue2-admin/logo.svg"><span class="back-menu-item-text">Vue2-Admin</span></a><a class="back-menu-item" href="https://ele-plus-form.xmwpro.com/" rel="external nofollow noreferrer" title="vue3-form" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/pages/resource/vue.svg"><span class="back-menu-item-text">vue3-form</span></a><a class="back-menu-item" href="https://ele-plus-table.xmwpro.com/" rel="external nofollow noreferrer" title="vue3-table" target="_blank" one-link-mark="yes"><img class="back-menu-item-icon" src="" data-lazy-src="https://ali-oss.xmwpro.com/pages/resource/vue.svg"><span class="back-menu-item-text">vue3-table</span></a></div></div></div></div><a id="site-name" href="/"><div class="title">Cyan</div><i class="fa-solid fa-house"></i></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fas fa-book"></i> <span>文库</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/archives/"><i class="fa-fw faa-tada fa-solid fa-box-archive"></i> <span>全部文章</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/tags/"><i class="fa-fw faa-tada fas fa-tags"></i> <span>标签</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/categories/"><i class="fa-fw faa-tada fas fa-shapes"></i> <span>分类</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fab fa-artstation"></i> <span>社交</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/link/"><i class="fa-fw faa-tada fa-solid fa-link"></i> <span>友人帐</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/fcircle/"><i class="fa-fw faa-tada fa-solid fa-user-group"></i> <span>朋友圈</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/guestbook/"><i class="fa-fw faa-tada fa-solid fa-envelope"></i> <span>留言板</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fas fa-coffee"></i> <span>休闲</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/music/"><i class="fa-fw faa-tada fa-solid fa-music"></i> <span>音乐馆</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/photoAlbum/"><i class="fa-fw faa-tada fa-solid fa-camera"></i> <span>相册</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/essay/"><i class="fa-fw faa-tada fa-solid fa-message"></i> <span>哔哔</span></a></li></ul></div><div class="menus_item"><a class="site-page group faa-parent animated-hover" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fa-fw faa-tada fa-solid fa-earth-asia"></i> <span>本站</span></a><ul class="menus_item_child"><li><a class="site-page child faa-parent animated-hover" href="/analysis/"><i class="fa-fw faa-tada fa-solid fa-chart-simple"></i> <span>博客统计</span></a></li><li><a class="site-page child faa-parent animated-hover" href="/about/"><i class="fa-fw faa-tada fa-regular fa-address-card"></i> <span>关于我</span></a></li></ul></div></div><center id="name-container"><span id="page-name" href="javascript:void(0);">PAGE_NAME</span></center></div><div id="nav-right"><div class="nav-button" id="search-button"><a class="social-icon search" href="javascript:void(0);" rel="external nofollow noreferrer" title="全局搜索"><i class="fas fa-search fa-fw"></i></a></div><div class="nav-button"><a class="social-icon" target="_blank" rel="noopener external nofollow noreferrer" href="https://travellings.cn/go.html" title="离开这里并访问下一个博客「开往服务」"><i class="fa-solid fa-subway"></i></a></div><div class="nav-button"><a class="social-icon random-post" href="javascript:toRandomPost();" rel="external nofollow noreferrer" title="随机前往一个文章"><i class="fa-solid fa-dice"></i></a></div><div class="nav-button" id="darkmode_navswitch"><a class="darkmode_switchbutton" type="button" title="浅色和深色模式转换" onclick="document.getElementById(&quot;darkmode&quot;).click()"><i class="fas fa-moon isMoon"></i><i class="fas fa-sun isSun"></i></a></div><div class="nav-button" id="go-up" title="回到顶部"><a class="totopbtn" href="javascript:void(0);" rel="external nofollow noreferrer"><span class="scroll-percent" onclick="btf.scrollToDest(0,500)"></span><i class="fas fa-arrow-up" onclick="btf.scrollToDest(0,500)"></i></a></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);" rel="external nofollow noreferrer"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><div class="post-container"><div class="post-container-categories"><a class="categories-link" href="/categories/Butterfly%E7%BE%8E%E5%8C%96/">Butterfly美化</a></div><div class="post-container-tags"><a class="tags-link" href="/tags/ButterFly/"><span class="tags-punctuation">#</span><span class="tags-name">ButterFly</span></a><a class="tags-link" href="/tags/Hexo/"><span class="tags-punctuation">#</span><span class="tags-name">Hexo</span></a></div></div><h1 class="post-title">添加 Cherry 樱花雨背景特效</h1><div id="post-meta"><div class="meta-secondline"><div class="post-meta-common post-meta-date" title="发表于 2022-04-25 14:53:15"><i class="fas fa-calendar fa-fw post-meta-icon"></i><time class="post-meta-date-created" datetime="2022-04-25T14:53:15.000Z">04-25</time></div><div class="post-meta-common post-meta-date" title="更新于 2023-06-26 09:26:36"><i class="fas fa-history fa-fw post-meta-icon"></i><time class="post-meta-date-updated" datetime="2022-04-25T14:53:15.000Z">06-26</time></div><div class="post-meta-common post-meta-wordcount" title="字数总计 1.3k"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="word-count">1.3k</span></div><div class="post-meta-common post-meta-read-time" title="阅读时长 8分钟"><i class="far fa-clock fa-fw post-meta-icon"></i><span>8分钟</span></div><div class="post-meta-common post-meta-region" title="作者的IP归属地为深圳"><i class="far fa-solid fa-location-dot post-meta-icon"></i><span>深圳</span></div><div class="post-meta-common post-meta-original" title="作者原创"><i class="far fa-solid fa-copyright post-meta-icon"></i><span>原创</span></div><div class="post-meta-common post-meta-commentcount" title="评论数" onclick='cyan.scrollTo("#post-comment")'><i class="fa-solid fa-comment fa-fw post-meta-icon"></i><a href="/post/736f6468.html#post-comment"><span id="twikoo-count"><i class="fa-solid fa-spinner fa-spin"></i></span></a></div></div></div></div><section class="main-hero-waves-area waves-area"><svg class="waves-svg" xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" viewBox="0 24 150 28" preserveAspectRatio="none" shape-rendering="auto"><defs><path id="gentle-wave" d="M-160 44c30 0 58-18 88-18s58 18 88 18 58-18 88-18 58 18 88 18v44h-352Z"></path></defs><g class="parallax"><use href="#gentle-wave" x="48" y="0"></use><use href="#gentle-wave" x="48" y="3"></use><use href="#gentle-wave" x="48" y="5"></use><use href="#gentle-wave" x="48" y="7"></use></g></svg></section></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="樱花雨-Cherry-背景特效"><a href="#樱花雨-Cherry-背景特效" class="headerlink" title="樱花雨 Cherry 背景特效"></a>樱花雨 Cherry 背景特效</h2><ol><li><p>新建 <code>[Blogroot]\themes\butterfly\source\css\custom\index.css</code>, 添加 Canvas 默认样式。</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.cherry-container</span> &#123;</span><br><span class="line">  <span class="attribute">position</span>: fixed;</span><br><span class="line">  <span class="attribute">width</span>: <span class="number">100%</span>;</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">100vh</span>;</span><br><span class="line">  <span class="attribute">margin</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">padding</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">left</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">top</span>: <span class="number">0</span>;</span><br><span class="line">  <span class="attribute">z-index</span>: -<span class="number">1</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></li><li><p>修改 <code>[Blogroot]\themes\butterfly\layout\includes\layout.pug</code>,在第 19 行左右添加元素 id 绑定</p><figure class="highlight diff"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">    if page.type !== &#x27;404&#x27;</span><br><span class="line"><span class="addition">+      #jsi-cherry-container(class=&#x27;cherry-container&#x27;)</span></span><br><span class="line">      #body-wrap(class=pageType)</span><br><span class="line">        include ./header/index.pug</span><br></pre></td></tr></table></figure></li><li><p>新建 <code>[Blogroot]\themes\butterfly\source\js\cherry.js</code></p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br><span class="line">153</span><br><span class="line">154</span><br><span class="line">155</span><br><span class="line">156</span><br><span class="line">157</span><br><span class="line">158</span><br><span class="line">159</span><br><span class="line">160</span><br><span class="line">161</span><br><span class="line">162</span><br><span class="line">163</span><br><span class="line">164</span><br><span class="line">165</span><br><span class="line">166</span><br><span class="line">167</span><br><span class="line">168</span><br><span class="line">169</span><br><span class="line">170</span><br><span class="line">171</span><br><span class="line">172</span><br><span class="line">173</span><br><span class="line">174</span><br><span class="line">175</span><br><span class="line">176</span><br><span class="line">177</span><br><span class="line">178</span><br><span class="line">179</span><br><span class="line">180</span><br><span class="line">181</span><br><span class="line">182</span><br><span class="line">183</span><br><span class="line">184</span><br><span class="line">185</span><br><span class="line">186</span><br><span class="line">187</span><br><span class="line">188</span><br><span class="line">189</span><br><span class="line">190</span><br><span class="line">191</span><br><span class="line">192</span><br><span class="line">193</span><br><span class="line">194</span><br><span class="line">195</span><br><span class="line">196</span><br><span class="line">197</span><br><span class="line">198</span><br><span class="line">199</span><br><span class="line">200</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">var</span> <span class="variable constant_">RENDERER</span> = &#123;</span><br><span class="line">    <span class="attr">INIT_CHERRY_BLOSSOM_COUNT</span>: <span class="number">30</span>,</span><br><span class="line">    <span class="attr">MAX_ADDING_INTERVAL</span>: <span class="number">10</span>,</span><br><span class="line"></span><br><span class="line">    <span class="attr">init</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">setParameters</span>();</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">reconstructMethods</span>();</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">createCherries</span>();</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">render</span>();</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">setParameters</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">$container</span> = $(<span class="string">&#x27;#jsi-cherry-container&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">width</span> = <span class="variable language_">this</span>.<span class="property">$container</span>.<span class="title function_">width</span>();</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">height</span> = <span class="variable language_">this</span>.<span class="property">$container</span>.<span class="title function_">height</span>();</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">context</span> = $(<span class="string">&#x27;&lt;canvas /&gt;&#x27;</span>).<span class="title function_">attr</span>(&#123; <span class="attr">width</span>: <span class="variable language_">this</span>.<span class="property">width</span>, <span class="attr">height</span>: <span class="variable language_">this</span>.<span class="property">height</span> &#125;).<span class="title function_">appendTo</span>(<span class="variable language_">this</span>.<span class="property">$container</span>).<span class="title function_">get</span>(<span class="number">0</span>).<span class="title function_">getContext</span>(<span class="string">&#x27;2d&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">cherries</span> = [];</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">maxAddingInterval</span> = <span class="title class_">Math</span>.<span class="title function_">round</span>(<span class="variable language_">this</span>.<span class="property">MAX_ADDING_INTERVAL</span> * <span class="number">1000</span> / <span class="variable language_">this</span>.<span class="property">width</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">addingInterval</span> = <span class="variable language_">this</span>.<span class="property">maxAddingInterval</span>;</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">reconstructMethods</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">render</span> = <span class="variable language_">this</span>.<span class="property">render</span>.<span class="title function_">bind</span>(<span class="variable language_">this</span>);</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">createCherries</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="number">0</span>, length = <span class="title class_">Math</span>.<span class="title function_">round</span>(<span class="variable language_">this</span>.<span class="property">INIT_CHERRY_BLOSSOM_COUNT</span> * <span class="variable language_">this</span>.<span class="property">width</span> / <span class="number">1000</span>); i &lt; length; i++) &#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">cherries</span>.<span class="title function_">push</span>(<span class="keyword">new</span> <span class="title function_">CHERRY_BLOSSOM</span>(<span class="variable language_">this</span>, <span class="literal">true</span>));</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">render</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="title function_">requestAnimationFrame</span>(<span class="variable language_">this</span>.<span class="property">render</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">context</span>.<span class="title function_">clearRect</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">width</span>, <span class="variable language_">this</span>.<span class="property">height</span>);</span><br><span class="line"></span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">cherries</span>.<span class="title function_">sort</span>(<span class="keyword">function</span> (<span class="params">cherry1, cherry2</span>) &#123;</span><br><span class="line">            <span class="keyword">return</span> cherry1.<span class="property">z</span> - cherry2.<span class="property">z</span>;</span><br><span class="line">        &#125;);</span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">var</span> i = <span class="variable language_">this</span>.<span class="property">cherries</span>.<span class="property">length</span> - <span class="number">1</span>; i &gt;= <span class="number">0</span>; i--) &#123;</span><br><span class="line">            <span class="keyword">if</span> (!<span class="variable language_">this</span>.<span class="property">cherries</span>[i].<span class="title function_">render</span>(<span class="variable language_">this</span>.<span class="property">context</span>)) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">cherries</span>.<span class="title function_">splice</span>(i, <span class="number">1</span>);</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (--<span class="variable language_">this</span>.<span class="property">addingInterval</span> == <span class="number">0</span>) &#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">addingInterval</span> = <span class="variable language_">this</span>.<span class="property">maxAddingInterval</span>;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">cherries</span>.<span class="title function_">push</span>(<span class="keyword">new</span> <span class="title function_">CHERRY_BLOSSOM</span>(<span class="variable language_">this</span>, <span class="literal">false</span>));</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line"><span class="keyword">var</span> <span class="variable constant_">CHERRY_BLOSSOM</span> = <span class="keyword">function</span> (<span class="params">renderer, isRandom</span>) &#123;</span><br><span class="line">    <span class="variable language_">this</span>.<span class="property">renderer</span> = renderer;</span><br><span class="line">    <span class="variable language_">this</span>.<span class="title function_">init</span>(isRandom);</span><br><span class="line">&#125;;</span><br><span class="line"><span class="variable constant_">CHERRY_BLOSSOM</span>.<span class="property"><span class="keyword">prototype</span></span> = &#123;</span><br><span class="line">    <span class="attr">FOCUS_POSITION</span>: <span class="number">300</span>,</span><br><span class="line">    <span class="attr">FAR_LIMIT</span>: <span class="number">600</span>,</span><br><span class="line">    <span class="attr">MAX_RIPPLE_COUNT</span>: <span class="number">100</span>,</span><br><span class="line">    <span class="attr">RIPPLE_RADIUS</span>: <span class="number">100</span>,</span><br><span class="line">    <span class="attr">SURFACE_RATE</span>: <span class="number">0.5</span>,</span><br><span class="line">    <span class="attr">SINK_OFFSET</span>: <span class="number">20</span>,</span><br><span class="line"></span><br><span class="line">    <span class="attr">init</span>: <span class="keyword">function</span> (<span class="params">isRandom</span>) &#123;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">x</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(-<span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">width</span>, <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">width</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">y</span> = isRandom ? <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(<span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span>) : <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> * <span class="number">1.5</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">z</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(<span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">FAR_LIMIT</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">vx</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(-<span class="number">2</span>, <span class="number">2</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">vy</span> = -<span class="number">2</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">theta</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(<span class="number">0</span>, <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">phi</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(<span class="number">0</span>, <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">psi</span> = <span class="number">0</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">dpsi</span> = <span class="variable language_">this</span>.<span class="title function_">getRandomValue</span>(<span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">600</span>, <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">300</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">opacity</span> = <span class="number">0</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">endTheta</span> = <span class="literal">false</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">endPhi</span> = <span class="literal">false</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">rippleCount</span> = <span class="number">0</span>;</span><br><span class="line"></span><br><span class="line">        <span class="keyword">var</span> axis = <span class="variable language_">this</span>.<span class="title function_">getAxis</span>(),</span><br><span class="line">            theta = <span class="variable language_">this</span>.<span class="property">theta</span> + <span class="title class_">Math</span>.<span class="title function_">ceil</span>(-(<span class="variable language_">this</span>.<span class="property">y</span> + <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> * <span class="variable language_">this</span>.<span class="property">SURFACE_RATE</span>) / <span class="variable language_">this</span>.<span class="property">vy</span>) * <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">500</span>;</span><br><span class="line">        theta %= <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>;</span><br><span class="line"></span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">offsetY</span> = <span class="number">40</span> * ((theta &lt;= <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">2</span> || theta &gt;= <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">3</span> / <span class="number">2</span>) ? -<span class="number">1</span> : <span class="number">1</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">thresholdY</span> = <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> / <span class="number">2</span> + <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> * <span class="variable language_">this</span>.<span class="property">SURFACE_RATE</span> * axis.<span class="property">rate</span>;</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">entityColor</span> = <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">context</span>.<span class="title function_">createRadialGradient</span>(<span class="number">0</span>, <span class="number">40</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">40</span>, <span class="number">80</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">entityColor</span>.<span class="title function_">addColorStop</span>(<span class="number">0</span>, <span class="string">&#x27;hsl(330, 70%, &#x27;</span> + <span class="number">50</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">entityColor</span>.<span class="title function_">addColorStop</span>(<span class="number">0.05</span>, <span class="string">&#x27;hsl(330, 40%,&#x27;</span> + <span class="number">55</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">entityColor</span>.<span class="title function_">addColorStop</span>(<span class="number">1</span>, <span class="string">&#x27;hsl(330, 20%, &#x27;</span> + <span class="number">70</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">shadowColor</span> = <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">context</span>.<span class="title function_">createRadialGradient</span>(<span class="number">0</span>, <span class="number">40</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">40</span>, <span class="number">80</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">shadowColor</span>.<span class="title function_">addColorStop</span>(<span class="number">0</span>, <span class="string">&#x27;hsl(330, 40%, &#x27;</span> + <span class="number">30</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">shadowColor</span>.<span class="title function_">addColorStop</span>(<span class="number">0.05</span>, <span class="string">&#x27;hsl(330, 40%,&#x27;</span> + <span class="number">30</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="property">shadowColor</span>.<span class="title function_">addColorStop</span>(<span class="number">1</span>, <span class="string">&#x27;hsl(330, 20%, &#x27;</span> + <span class="number">40</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>);</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">getRandomValue</span>: <span class="keyword">function</span> (<span class="params">min, max</span>) &#123;</span><br><span class="line">        <span class="keyword">return</span> min + (max - min) * <span class="title class_">Math</span>.<span class="title function_">random</span>();</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">getAxis</span>: <span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">        <span class="keyword">var</span> rate = <span class="variable language_">this</span>.<span class="property">FOCUS_POSITION</span> / (<span class="variable language_">this</span>.<span class="property">z</span> + <span class="variable language_">this</span>.<span class="property">FOCUS_POSITION</span>),</span><br><span class="line">            x = <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">width</span> / <span class="number">2</span> + <span class="variable language_">this</span>.<span class="property">x</span> * rate,</span><br><span class="line">            y = <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> / <span class="number">2</span> - <span class="variable language_">this</span>.<span class="property">y</span> * rate;</span><br><span class="line">        <span class="keyword">return</span> &#123; <span class="attr">rate</span>: rate, <span class="attr">x</span>: x, <span class="attr">y</span>: y &#125;;</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">renderCherry</span>: <span class="keyword">function</span> (<span class="params">context, axis</span>) &#123;</span><br><span class="line">        context.<span class="title function_">beginPath</span>();</span><br><span class="line">        context.<span class="title function_">moveTo</span>(<span class="number">0</span>, <span class="number">40</span>);</span><br><span class="line">        context.<span class="title function_">bezierCurveTo</span>(-<span class="number">60</span>, <span class="number">20</span>, -<span class="number">10</span>, -<span class="number">60</span>, <span class="number">0</span>, -<span class="number">20</span>);</span><br><span class="line">        context.<span class="title function_">bezierCurveTo</span>(<span class="number">10</span>, -<span class="number">60</span>, <span class="number">60</span>, <span class="number">20</span>, <span class="number">0</span>, <span class="number">40</span>);</span><br><span class="line">        context.<span class="title function_">fill</span>();</span><br><span class="line"></span><br><span class="line">        <span class="keyword">for</span> (<span class="keyword">var</span> i = -<span class="number">4</span>; i &lt; <span class="number">4</span>; i++) &#123;</span><br><span class="line">            context.<span class="title function_">beginPath</span>();</span><br><span class="line">            context.<span class="title function_">moveTo</span>(<span class="number">0</span>, <span class="number">40</span>);</span><br><span class="line">            context.<span class="title function_">quadraticCurveTo</span>(i * <span class="number">12</span>, <span class="number">10</span>, i * <span class="number">4</span>, -<span class="number">24</span> + <span class="title class_">Math</span>.<span class="title function_">abs</span>(i) * <span class="number">2</span>);</span><br><span class="line">            context.<span class="title function_">stroke</span>();</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;,</span><br><span class="line">    <span class="attr">render</span>: <span class="keyword">function</span> (<span class="params">context</span>) &#123;</span><br><span class="line">        <span class="keyword">var</span> axis = <span class="variable language_">this</span>.<span class="title function_">getAxis</span>();</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (axis.<span class="property">y</span> == <span class="variable language_">this</span>.<span class="property">thresholdY</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">rippleCount</span> &lt; <span class="variable language_">this</span>.<span class="property">MAX_RIPPLE_COUNT</span>) &#123;</span><br><span class="line">            context.<span class="title function_">save</span>();</span><br><span class="line">            context.<span class="property">lineWidth</span> = <span class="number">2</span>;</span><br><span class="line">            context.<span class="property">strokeStyle</span> = <span class="string">&#x27;hsla(0, 0%, 100%, &#x27;</span> + (<span class="variable language_">this</span>.<span class="property">MAX_RIPPLE_COUNT</span> - <span class="variable language_">this</span>.<span class="property">rippleCount</span>) / <span class="variable language_">this</span>.<span class="property">MAX_RIPPLE_COUNT</span> + <span class="string">&#x27;)&#x27;</span>;</span><br><span class="line">            context.<span class="title function_">translate</span>(axis.<span class="property">x</span> + <span class="variable language_">this</span>.<span class="property">offsetY</span> * axis.<span class="property">rate</span> * (<span class="variable language_">this</span>.<span class="property">theta</span> &lt;= <span class="title class_">Math</span>.<span class="property">PI</span> ? -<span class="number">1</span> : <span class="number">1</span>), axis.<span class="property">y</span>);</span><br><span class="line">            context.<span class="title function_">scale</span>(<span class="number">1</span>, <span class="number">0.3</span>);</span><br><span class="line">            context.<span class="title function_">beginPath</span>();</span><br><span class="line">            context.<span class="title function_">arc</span>(<span class="number">0</span>, <span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">rippleCount</span> / <span class="variable language_">this</span>.<span class="property">MAX_RIPPLE_COUNT</span> * <span class="variable language_">this</span>.<span class="property">RIPPLE_RADIUS</span> * axis.<span class="property">rate</span>, <span class="number">0</span>, <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>, <span class="literal">false</span>);</span><br><span class="line">            context.<span class="title function_">stroke</span>();</span><br><span class="line">            context.<span class="title function_">restore</span>();</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">rippleCount</span>++;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (axis.<span class="property">y</span> &lt; <span class="variable language_">this</span>.<span class="property">thresholdY</span> || (!<span class="variable language_">this</span>.<span class="property">endTheta</span> || !<span class="variable language_">this</span>.<span class="property">endPhi</span>)) &#123;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">y</span> &lt;= <span class="number">0</span>) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">opacity</span> = <span class="title class_">Math</span>.<span class="title function_">min</span>(<span class="variable language_">this</span>.<span class="property">opacity</span> + <span class="number">0.01</span>, <span class="number">1</span>);</span><br><span class="line">            &#125;</span><br><span class="line">            context.<span class="title function_">save</span>();</span><br><span class="line">            context.<span class="property">globalAlpha</span> = <span class="variable language_">this</span>.<span class="property">opacity</span>;</span><br><span class="line">            context.<span class="property">fillStyle</span> = <span class="variable language_">this</span>.<span class="property">shadowColor</span>;</span><br><span class="line">            context.<span class="property">strokeStyle</span> = <span class="string">&#x27;hsl(330, 30%,&#x27;</span> + <span class="number">40</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>;</span><br><span class="line">            context.<span class="title function_">translate</span>(axis.<span class="property">x</span>, <span class="title class_">Math</span>.<span class="title function_">max</span>(axis.<span class="property">y</span>, <span class="variable language_">this</span>.<span class="property">thresholdY</span> + <span class="variable language_">this</span>.<span class="property">thresholdY</span> - axis.<span class="property">y</span>));</span><br><span class="line">            context.<span class="title function_">rotate</span>(<span class="title class_">Math</span>.<span class="property">PI</span> - <span class="variable language_">this</span>.<span class="property">theta</span>);</span><br><span class="line">            context.<span class="title function_">scale</span>(axis.<span class="property">rate</span> * -<span class="title class_">Math</span>.<span class="title function_">sin</span>(<span class="variable language_">this</span>.<span class="property">phi</span>), axis.<span class="property">rate</span>);</span><br><span class="line">            context.<span class="title function_">translate</span>(<span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">offsetY</span>);</span><br><span class="line">            <span class="variable language_">this</span>.<span class="title function_">renderCherry</span>(context, axis);</span><br><span class="line">            context.<span class="title function_">restore</span>();</span><br><span class="line">        &#125;</span><br><span class="line">        context.<span class="title function_">save</span>();</span><br><span class="line">        context.<span class="property">fillStyle</span> = <span class="variable language_">this</span>.<span class="property">entityColor</span>;</span><br><span class="line">        context.<span class="property">strokeStyle</span> = <span class="string">&#x27;hsl(330, 40%,&#x27;</span> + <span class="number">70</span> * (<span class="number">0.3</span> + axis.<span class="property">rate</span>) + <span class="string">&#x27;%)&#x27;</span>;</span><br><span class="line">        context.<span class="title function_">translate</span>(axis.<span class="property">x</span>, axis.<span class="property">y</span> + <span class="title class_">Math</span>.<span class="title function_">abs</span>(<span class="variable language_">this</span>.<span class="property">SINK_OFFSET</span> * <span class="title class_">Math</span>.<span class="title function_">sin</span>(<span class="variable language_">this</span>.<span class="property">psi</span>) * axis.<span class="property">rate</span>));</span><br><span class="line">        context.<span class="title function_">rotate</span>(<span class="variable language_">this</span>.<span class="property">theta</span>);</span><br><span class="line">        context.<span class="title function_">scale</span>(axis.<span class="property">rate</span> * <span class="title class_">Math</span>.<span class="title function_">sin</span>(<span class="variable language_">this</span>.<span class="property">phi</span>), axis.<span class="property">rate</span>);</span><br><span class="line">        context.<span class="title function_">translate</span>(<span class="number">0</span>, <span class="variable language_">this</span>.<span class="property">offsetY</span>);</span><br><span class="line">        <span class="variable language_">this</span>.<span class="title function_">renderCherry</span>(context, axis);</span><br><span class="line">        context.<span class="title function_">restore</span>();</span><br><span class="line"></span><br><span class="line">        <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">y</span> &lt;= -<span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> / <span class="number">4</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (!<span class="variable language_">this</span>.<span class="property">endTheta</span>) &#123;</span><br><span class="line">                <span class="keyword">for</span> (<span class="keyword">var</span> theta = <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">2</span>, end = <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">3</span> / <span class="number">2</span>; theta &lt;= end; theta += <span class="title class_">Math</span>.<span class="property">PI</span>) &#123;</span><br><span class="line">                    <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">theta</span> &lt; theta &amp;&amp; <span class="variable language_">this</span>.<span class="property">theta</span> + <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">200</span> &gt; theta) &#123;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="property">theta</span> = theta;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="property">endTheta</span> = <span class="literal">true</span>;</span><br><span class="line">                        <span class="keyword">break</span>;</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="keyword">if</span> (!<span class="variable language_">this</span>.<span class="property">endPhi</span>) &#123;</span><br><span class="line">                <span class="keyword">for</span> (<span class="keyword">var</span> phi = <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">8</span>, end = <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">7</span> / <span class="number">8</span>; phi &lt;= end; phi += <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">3</span> / <span class="number">4</span>) &#123;</span><br><span class="line">                    <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">phi</span> &lt; phi &amp;&amp; <span class="variable language_">this</span>.<span class="property">phi</span> + <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">200</span> &gt; phi) &#123;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="property">phi</span> = <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">8</span>;</span><br><span class="line">                        <span class="variable language_">this</span>.<span class="property">endPhi</span> = <span class="literal">true</span>;</span><br><span class="line">                        <span class="keyword">break</span>;</span><br><span class="line">                    &#125;</span><br><span class="line">                &#125;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (!<span class="variable language_">this</span>.<span class="property">endTheta</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (axis.<span class="property">y</span> == <span class="variable language_">this</span>.<span class="property">thresholdY</span>) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">theta</span> += <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">200</span> * ((<span class="variable language_">this</span>.<span class="property">theta</span> &lt; <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">2</span> || (<span class="variable language_">this</span>.<span class="property">theta</span> &gt;= <span class="title class_">Math</span>.<span class="property">PI</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">theta</span> &lt; <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">3</span> / <span class="number">2</span>)) ? <span class="number">1</span> : -<span class="number">1</span>);</span><br><span class="line">            &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">theta</span> += <span class="title class_">Math</span>.<span class="property">PI</span> / <span class="number">500</span>;</span><br><span class="line">            &#125;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">theta</span> %= <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">endPhi</span>) &#123;</span><br><span class="line">            <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">rippleCount</span> == <span class="variable language_">this</span>.<span class="property">MAX_RIPPLE_COUNT</span>) &#123;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">psi</span> += <span class="variable language_">this</span>.<span class="property">dpsi</span>;</span><br><span class="line">                <span class="variable language_">this</span>.<span class="property">psi</span> %= <span class="title class_">Math</span>.<span class="property">PI</span> * <span class="number">2</span>;</span><br><span class="line">            &#125;</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">phi</span> += <span class="title class_">Math</span>.<span class="property">PI</span> / ((axis.<span class="property">y</span> == <span class="variable language_">this</span>.<span class="property">thresholdY</span>) ? <span class="number">200</span> : <span class="number">500</span>);</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">phi</span> %= <span class="title class_">Math</span>.<span class="property">PI</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">if</span> (<span class="variable language_">this</span>.<span class="property">y</span> &lt;= -<span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> * <span class="variable language_">this</span>.<span class="property">SURFACE_RATE</span>) &#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">x</span> += <span class="number">2</span>;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">y</span> = -<span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">height</span> * <span class="variable language_">this</span>.<span class="property">SURFACE_RATE</span>;</span><br><span class="line">        &#125; <span class="keyword">else</span> &#123;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">x</span> += <span class="variable language_">this</span>.<span class="property">vx</span>;</span><br><span class="line">            <span class="variable language_">this</span>.<span class="property">y</span> += <span class="variable language_">this</span>.<span class="property">vy</span>;</span><br><span class="line">        &#125;</span><br><span class="line">        <span class="keyword">return</span> <span class="variable language_">this</span>.<span class="property">z</span> &gt; -<span class="variable language_">this</span>.<span class="property">FOCUS_POSITION</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">z</span> &lt; <span class="variable language_">this</span>.<span class="property">FAR_LIMIT</span> &amp;&amp; <span class="variable language_">this</span>.<span class="property">x</span> &lt; <span class="variable language_">this</span>.<span class="property">renderer</span>.<span class="property">width</span> * <span class="number">1.5</span>;</span><br><span class="line">    &#125;</span><br><span class="line">&#125;;</span><br><span class="line">$(<span class="keyword">function</span> (<span class="params"></span>) &#123;</span><br><span class="line">    <span class="variable constant_">RENDERER</span>.<span class="title function_">init</span>();</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure></li><li><p>引入对应的资源,修改 <code>_config.butterfly.yml</code>,在 inject 配置项添加 cherry.js</p><figure class="highlight yml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">head:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;link</span> <span class="string">rel=&quot;stylesheet&quot;</span> <span class="string">href=&quot;/css/custom/index.css&quot;</span>  <span class="string">media=&quot;defer&quot;</span> <span class="string">onload=&quot;this.media=&#x27;all&#x27;&quot;&gt;</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script</span> <span class="string">src=&quot;https://www.jq22.com/jquery/jquery-3.3.1.js&quot;&gt;&lt;/script&gt;</span></span><br><span class="line">  <span class="attr">bottom:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script</span> <span class="string">src=&quot;/js/cherry.js&quot;</span> <span class="string">async&gt;&lt;/script&gt;</span></span><br></pre></td></tr></table></figure><div class="tip theme fa-info"><p>需要 jQuery 支持,引入静态资源,不然会报 $ is not defined</p></div></li><li><p>执行 hexo c, hexo g , hexo s ,大功告成,不出意外的话,就能正常显示了</p></li></ol></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者:</span> <span class="post-copyright-info"><a href="https://xmwpro.com">Cyan</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接:</span> <span class="post-copyright-info"><a href="https://xmwpro.com/post/736f6468.html">https://xmwpro.com/post/736f6468.html</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明:</span> <span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="external nofollow noreferrer" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://xmwpro.com" target="_blank">Cyan</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/ButterFly/"><span class="tags-punctuation">#</span><span class="tags-name">ButterFly</span><sup>14</sup></a><a class="post-meta__tags" href="/tags/Hexo/"><span class="tags-punctuation">#</span><span class="tags-name">Hexo</span><sup>19</sup></a></div><div class="post_share"><div class="social-share" data-image="https://ali-oss.xmwpro.com/global/avatar.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/share.min.css" media="print" onload='this.media="all"'><script src="https://ali-oss.xmwpro.com/cdn/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="https://ali-oss.xmwpro.com/global/wx-pay.jpeg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://ali-oss.xmwpro.com/global/wx-pay.jpeg" alt="微信"></a><div class="post-qr-code-desc">微信</div></li><li class="reward-item"><a href="https://ali-oss.xmwpro.com/global/zfb-pay.jpeg" rel="external nofollow noreferrer" target="_blank"><img class="post-qr-code-img" src="" data-lazy-src="https://ali-oss.xmwpro.com/global/zfb-pay.jpeg" alt="支付宝"></a><div class="post-qr-code-desc">支付宝</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/post/b8a1da20.html" title="基于 Vue3 + Element-plus 表单 Form 组件二次封装"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover42.jpg" onerror='onerror=null,src="/img/404.jpg"' alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">基于 Vue3 + Element-plus 表单 Form 组件二次封装</div></div></a></div><div class="next-post pull-right"><a href="/post/d1c1d72a.html" title="ButterFly 主题美化日记"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover20.jpg" onerror='onerror=null,src="/img/404.jpg"' alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">ButterFly 主题美化日记</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list swiper"><div class="swiper-wrapper"><div class="swiper-slide related-item"><a href="/post/35d76de1.html" title="Friend Link 友链样式魔改"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover50.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-13</div><div class="title">Friend Link 友链样式魔改</div></div></a></div><div class="swiper-slide related-item"><a href="/post/a543f113.html" title="Menu 添加 Iconfont 多彩图标"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover6.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-10</div><div class="title">Menu 添加 Iconfont 多彩图标</div></div></a></div><div class="swiper-slide related-item"><a href="/post/2b2d021b.html" title="添加右键菜单 Right Menu"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover15.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-31</div><div class="title">添加右键菜单 Right Menu</div></div></a></div><div class="swiper-slide related-item"><a href="/post/8acce9aa.html" title="使用 Hexo-abbrlink 生成唯一文章链接"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover6.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-12</div><div class="title">使用 Hexo-abbrlink 生成唯一文章链接</div></div></a></div><div class="swiper-slide related-item"><a href="/post/623e5e60.html" title="使用 Shields.io 美化 Footer"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover47.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-09</div><div class="title">使用 Shields.io 美化 Footer</div></div></a></div><div class="swiper-slide related-item"><a href="/post/c94d89e8.html" title="引入 Aplayer 音乐播放器"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover5.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-12</div><div class="title">引入 Aplayer 音乐播放器</div></div></a></div><div class="swiper-slide related-item"><a href="/post/3ab4ab8f.html" title="引入 Iconfont 阿里图标矢量库"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover46.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-09</div><div class="title">引入 Iconfont 阿里图标矢量库</div></div></a></div><div class="swiper-slide related-item"><a href="/post/b380412b.html" title="引入 Wow.js Animation 动画"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover13.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-13</div><div class="title">引入 Wow.js Animation 动画</div></div></a></div><div class="swiper-slide related-item"><a href="/post/442df491.html" title="留言板 爱心❤️ 信封✉️ 动画"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover37.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-12</div><div class="title">留言板 爱心❤️ 信封✉️ 动画</div></div></a></div><div class="swiper-slide related-item"><a href="/post/acd421de.html" title="自定义 Loading 黏性加载动画"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover31.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-11</div><div class="title">自定义 Loading 黏性加载动画</div></div></a></div><div class="swiper-slide related-item"><a href="/post/3f97fe61.html" title="添加 Echarts 统计图表"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover48.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-06-09</div><div class="title">添加 Echarts 统计图表</div></div></a></div><div class="swiper-slide related-item"><a href="/post/8c8593e1.html" title="渐变星空 Sky 粒子背景特效"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover10.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-06-21</div><div class="title">渐变星空 Sky 粒子背景特效</div></div></a></div><div class="swiper-slide related-item"><a href="/post/d1c1d72a.html" title="ButterFly 主题美化日记"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover6.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-26</div><div class="title">ButterFly 主题美化日记</div></div></a></div><div class="swiper-slide related-item"><a href="/post/7c16c4bb.html" title="Hexo 博客优化日记"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover44.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-26</div><div class="title">Hexo 博客优化日记</div></div></a></div><div class="swiper-slide related-item"><a href="/post/49b73b87.html" title="使用 Gulp 压缩博客静态资源"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover18.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-04-30</div><div class="title">使用 Gulp 压缩博客静态资源</div></div></a></div><div class="swiper-slide related-item"><a href="/post/b9948411.html" title="从零开始搭建 Hexo 个人博客"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover25.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-11</div><div class="title">从零开始搭建 Hexo 个人博客</div></div></a></div><div class="swiper-slide related-item"><a href="/post/1a856e69.html" title="使用 PicGo 配置 阿里云OSS 搭建图床"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover14.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-16</div><div class="title">使用 PicGo 配置 阿里云OSS 搭建图床</div></div></a></div><div class="swiper-slide related-item"><a href="/post/d1c57d89.html" title="使用 Vercel 托管 Vue3 前端静态页面"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover24.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-18</div><div class="title">使用 Vercel 托管 Vue3 前端静态页面</div></div></a></div><div class="swiper-slide related-item"><a href="/post/812734f8.html" title="使用 Vercel 来加速 Hexo 博客"><img class="cover" src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover13.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2022-05-05</div><div class="title">使用 Vercel 来加速 Hexo 博客</div></div></a></div></div><div class="related-swiper-scrollbar"></div></div></div><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i> <span>评论</span></div><div class="comment-tips">您无需删除空行，直接评论以获取最佳展示效果</div></div><div class="comment-wrap"><div><div id="twikoo-wrap"></div></div></div><div class="barrageswiper"><div class="swiper"><div class="swiper-wrapper"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="card-info-my"><div class="card-info-my-avatar"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/avatar.jpg" onerror='this.onerror=null,this.src="/img/friend_404.gif"' alt="avatar"></div><div class="card-info-my-name"><div class="card-info-my-name-welcome"></div><div class="card-info-my-name-text">谢明伟</div></div></div><div class="card-info-content"><b>记录学习、生活和有趣的事</b></div><div class="card-info-announcement">好好吃饭🍣 好好睡觉💤 敲敲代码💻 谈谈恋爱💑</div><div class="card-info-social"><div class="card-info-social-icon"><a class="social-icon" href="https://github.com/Cyan-Xmw" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="iconfont cyan-github-fill"></i></a></div><a class="card-info-social-more" href="/about/"><i class="fas fa-circle-chevron-right"></i><span class="card-info-social-more-text">了解更多</span></a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%A8%B1%E8%8A%B1%E9%9B%A8-Cherry-%E8%83%8C%E6%99%AF%E7%89%B9%E6%95%88"><span class="toc-number">1.</span> <span class="toc-text">樱花雨 Cherry 背景特效</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="aside-list"><div class="aside-list-item no-cover"><a class="thumbnail" href="/post/a109015f.html" title="TS 中的类型验算,高级通用 API 实现"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover17.jpg" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="TS 中的类型验算,高级通用 API 实现"></a><div class="content"><a class="title" href="/post/a109015f.html" title="TS 中的类型验算,高级通用 API 实现">TS 中的类型验算,高级通用 API 实现</a><time datetime="2023-06-26T15:26:24.000Z" title="发表于 2023-06-26 15:26:24">2023-06-26</time></div></div><div class="aside-list-item no-cover"><a class="thumbnail" href="/post/1ce87d42.html" title="使用 sort-imports 排序规则美化头部 import 代码"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover22.jpg" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="使用 sort-imports 排序规则美化头部 import 代码"></a><div class="content"><a class="title" href="/post/1ce87d42.html" title="使用 sort-imports 排序规则美化头部 import 代码">使用 sort-imports 排序规则美化头部 import 代码</a><time datetime="2023-06-06T15:39:24.000Z" title="发表于 2023-06-06 15:39:24">2023-06-06</time></div></div><div class="aside-list-item no-cover"><a class="thumbnail" href="/post/b3e4ecaf.html" title="Vue 中如何监控用户网络状态"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover18.jpg" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="Vue 中如何监控用户网络状态"></a><div class="content"><a class="title" href="/post/b3e4ecaf.html" title="Vue 中如何监控用户网络状态">Vue 中如何监控用户网络状态</a><time datetime="2023-05-22T16:08:02.000Z" title="发表于 2023-05-22 16:08:02">2023-05-22</time></div></div><div class="aside-list-item no-cover"><a class="thumbnail" href="/post/50b97751.html" title="在 vite 中使用 glob 实现约定式路由"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover43.jpg" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="在 vite 中使用 glob 实现约定式路由"></a><div class="content"><a class="title" href="/post/50b97751.html" title="在 vite 中使用 glob 实现约定式路由">在 vite 中使用 glob 实现约定式路由</a><time datetime="2023-05-16T16:35:16.000Z" title="发表于 2023-05-16 16:35:16">2023-05-16</time></div></div><div class="aside-list-item no-cover"><a class="thumbnail" href="/post/7b74bd27.html" title="基于 React + Nest 的后台应用"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/posts/post_cover45.jpg" onerror='this.onerror=null,this.src="/img/404.jpg"' alt="基于 React + Nest 的后台应用"></a><div class="content"><a class="title" href="/post/7b74bd27.html" title="基于 React + Nest 的后台应用">基于 React + Nest 的后台应用</a><time datetime="2023-04-18T10:39:21.000Z" title="发表于 2023-04-18 10:39:21">2023-04-18</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="site-business"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/business.svg" alt="Cyan"></div><div class="site-services"><div class="site-services-link"><a class="site-services-link-item" href="https://www.aliyun.com/" rel="external nofollow noreferrer" target="_blank" title="阿里云提供cdn加速和云存储服务"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/aliyun.svg" alt="阿里云"></a><a class="site-services-link-item" href="https://www.foreverblog.cn/blog/4240.html/" rel="external nofollow noreferrer" target="_blank" title="十年之约虫洞服务"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/foreverblog-zh.svg" alt="十年之约"></a><a class="site-services-link-item" href="https://beian.miit.gov.cn/" rel="external nofollow noreferrer" target="_blank" title="粤ICP备2023007649号"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/icp.png" alt="粤ICP备2023007649号"><span>粤ICP备2023007649号</span></a><a class="site-services-link-item" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030402006264" rel="external nofollow noreferrer" target="_blank" title="粤公网安备44030402006264号"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/security.png" alt="粤公网安备44030402006264号"><span>粤公网安备44030402006264号</span></a></div></div><div class="footer_custom_text"><p style="margin:0"><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io/" style="margin-inline:5px"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/hexo.svg" alt="博客框架 Hexo"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://butterfly.js.org/" style="margin-inline:5px"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/Butterfly.svg" alt="主题 Butterfly"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/" style="margin-inline:5px"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/github.svg" alt="本站托管于 Github"></a><a target="_blank" rel="noopener external nofollow noreferrer" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" style="margin-inline:5px"><img src="" data-lazy-src="https://ali-oss.xmwpro.com/global/copyright.svg" alt="本站采用知识共享署名-非商业性使用-相同方式共享4.0国际许可协议进行许可"></a></p></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="to_comment" type="button" title="直达评论" onclick='cyan.scrollTo("#post-comment")'><i class="fas fa-comments"></i></button><button id="toggle-barrage" type="button" title="开启/关闭弹幕" onclick="cyan.switchCommentBarrage()"><i class="iconfont cyan-barrage"></i></button><button id="toggle-music" type="button" title="播放/暂停音乐" onclick="cyan.musicToggle()"><i class="fas fa-solid fa-music"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="nav-music"><div id="nav-music-hoverTips" onclick="cyan.musicToggle()">播放音乐</div><meting-js id="6589687940" server="netease" type="playlist" mutex="true" preload="none" theme="var(--cyan-theme-color)" data-lrctype="0" order="random"></meting-js></div><div id="algolia-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">全局搜索</span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="search-wrap"><div id="algolia-search-input"></div><div id="algolia-search-results"><div id="algolia-hits"></div><div id="algolia-pagination"></div><div id="algolia-info"><div class="algolia-stats"></div><div class="algolia-poweredBy"></div></div></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/fancybox.umd.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/instantclick-1.2.2.js" type="module"></script><script src="https://ali-oss.xmwpro.com/cdn/js/lazyload.iife.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/snackbar.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/algoliasearch-lite.umd.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/instantsearch.production.min.js"></script><script src="/js/search/algolia.js"></script><div class="js-pjax"><script>(()=>{const o=()=>{twikoo.init(Object.assign({el:"#twikoo-wrap",envId:"https://twikoo.xmwpro.com/",region:"",onCommentLoaded:function(){btf.loadLightbox(document.querySelectorAll("#twikoo .tk-content img:not(.tk-owo-emotion)"))}},null)),GLOBAL_CONFIG_SITE.isPost&&(()=>{const o=document.getElementById("twikoo-count");o&&twikoo.getCommentsCount({envId:"https://twikoo.xmwpro.com/",region:"",urls:[window.location.pathname],includeReply:!1}).then((function(t){o.innerText=t[0].count})).catch((function(o){console.error(o)}))})()},t=()=>{"object"!=typeof twikoo?getScript("https://ali-oss.xmwpro.com/cdn/js/twikoo.all.min.js").then(o):setTimeout(o,0)};t()})()</script></div><script>window.addEventListener("load",(()=>{const e=e=>{let t="";if(e.length)for(let n=0;n<e.length;n++){t+="<div class='aside-list-item'>";{const a="data-lazy-src";t+=`<a href='${e[n].url}' class='thumbnail'><img ${a}='${e[n].avatar}' alt='${e[n].nick}'></a>`}t+=`<div class='content'>\n        <a class='comment' href='${e[n].url}' title='${e[n].content}'>${e[n].content}</a>\n        <div class='name'><span>${e[n].nick} / </span><time datetime="${e[n].date}">${btf.diffDate(e[n].date,!0)}</time></div>\n        </div></div>`}else t+="没有评论";let n=document.querySelector("#card-newest-comments .aside-list");n.innerHTML=t,window.lazyLoadInstance&&window.lazyLoadInstance.update(),window.pjax&&window.pjax.refresh(n)},t=()=>{if(document.querySelector("#card-newest-comments .aside-list")){const t=saveToLocal.get("twikoo-newest-comments");t?e(JSON.parse(t)):(()=>{const t=()=>{twikoo.getRecentComments({envId:"https://twikoo.xmwpro.com/",region:"",pageSize:6,includeReply:!0}).then((function(t){const n=t.map((e=>{return{content:(t=e.comment,""===t||(t=(t=(t=(t=t.replace(/<img.*?src="(.*?)"?[^\>]+>/gi,"[图片]")).replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi,"[链接]")).replace(/<pre><code>.*?<\/pre>/gi,"[代码]")).replace(/<[^>]+>/g,"")).length>150&&(t=t.substring(0,150)+"..."),t),avatar:e.avatar,nick:e.nick,url:e.url+"#"+e.id,date:new Date(e.created).toISOString()};var t}));saveToLocal.set("twikoo-newest-comments",JSON.stringify(n),10/1440),e(n)})).catch((function(e){document.querySelector("#card-newest-comments .aside-list").innerHTML="无法获取评论，请确认相关配置是否正确"}))};"object"==typeof twikoo?t():getScript("https://ali-oss.xmwpro.com/cdn/js/twikoo.all.min.js").then(t)})()}};t(),document.addEventListener("pjax:complete",t)}))</script><script async data-pjax src="/js/custom.js"></script><script async data-pjax src="/js/cascade.js"></script><script defer data-pjax src="//at.alicdn.com/t/c/font_3348168_pqjhlyxfz9r.js"></script><script async src="/js/commentBarrage.js"></script><script async data-pjax src="/js/sky.js"></script><script src="https://sdk.51.la/perf/js-sdk-perf.min.js" crossorigin="anonymous"></script><script>LA.init({id:"JxZKIeqz3SoTqaVu",ck:"JxZKIeqz3SoTqaVu"})</script><script>(new LingQue.Monitor).init({id:"JxZKIeqz3SoTqaVu",sendSuspicious:!0})</script><script src="/cyan/random.js"></script><script>let tianliGPT_postSelector="#post #article-container",tianliGPT_key="nWP7yQwRFXvk0piPhO2w"</script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/tianli_gpt.js"></script><link rel="stylesheet" href="https://ali-oss.xmwpro.com/cdn/css/APlayer.min.css" media="print" onload='this.media="all"'><script src="https://ali-oss.xmwpro.com/cdn/js/APlayer.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/Meting.min.js"></script><script src="https://ali-oss.xmwpro.com/cdn/js/pjax.min.js"></script><script>let pjaxSelectors=["head > title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"];var pjax=new Pjax({elements:'a:not([target="_blank"]):not([href="/tags/"]):not([href="/categories/"]):not([href="/analysis/"]):not([href="/fcircle/"])',selectors:pjaxSelectors,cacheBust:!1,analytics:!0,scrollRestoration:!1});document.addEventListener("pjax:send",(function(){if(window.tocScrollFn&&window.removeEventListener("scroll",window.tocScrollFn),window.scrollCollect&&window.removeEventListener("scroll",scrollCollect),document.getElementById("rightside").style.cssText="opacity: ''; transform: ''",window.aplayers)for(let e=0;e<window.aplayers.length;e++)window.aplayers[e].options.fixed||window.aplayers[e].destroy();"object"==typeof typed&&typed.destroy();const e=document.body.classList;e.contains("read-mode")&&e.remove("read-mode"),"object"==typeof disqusjs&&disqusjs.destroy()})),document.addEventListener("pjax:complete",(function(){window.refreshFn(),document.querySelectorAll("script[data-pjax]").forEach((e=>{const t=document.createElement("script"),o=e.text||e.textContent||e.innerHTML||"";Array.from(e.attributes).forEach((e=>t.setAttribute(e.name,e.value))),t.appendChild(document.createTextNode(o)),e.parentNode.replaceChild(t,e)})),GLOBAL_CONFIG.islazyload&&window.lazyLoadInstance.update(),"function"==typeof chatBtnFn&&chatBtnFn(),"function"==typeof panguInit&&panguInit(),"function"==typeof gtag&&gtag("config","G-2P0LMHZNDD",{page_path:window.location.pathname}),"object"==typeof _hmt&&_hmt.push(["_trackPageview",window.location.pathname]),"function"==typeof loadMeting&&document.getElementsByClassName("aplayer").length&&loadMeting(),"object"==typeof Prism&&Prism.highlightAll()})),document.addEventListener("pjax:error",(e=>{404===e.request.status&&pjax.loadUrl("/404.html")}))</script></div><script>var fdata={apiurl:"https://friend-api.xmwpro.com/",initnumber:30,stepnumber:30,error_img:"https://npm.elemecdn.com/akilar-candyassets/image/404.gif"};localStorage.setItem("fdatalist",JSON.stringify(fdata))</script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/fetch-friend.js"></script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/random-friends-post.js"></script><script async src="//at.alicdn.com/t/c/font_3344355_6og082zqzfd.js"></script><div class="js-pjax"><script async>for(var arr=document.getElementsByClassName("recent-post-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("bbTimeList"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("card-widget"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("category-in-bar"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration",""),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("bber-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__fadeInUp"),arr[i].setAttribute("data-wow-duration","1.5s"),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script><script async>for(var arr=document.getElementsByClassName("statistics-item"),i=0;i<arr.length;i++)arr[i].classList.add("wow"),arr[i].classList.add("animate__zoomIn"),arr[i].setAttribute("data-wow-duration","1.5s"),arr[i].setAttribute("data-wow-delay",""),arr[i].setAttribute("data-wow-offset","20"),arr[i].setAttribute("data-wow-iteration","")</script></div><script defer src="https://ali-oss.xmwpro.com/cdn/js/wow.min.js"></script><script defer src="https://ali-oss.xmwpro.com/cdn/js/wow_init.js"></script><script data-pjax src="https://ali-oss.xmwpro.com/cdn/js/gitcalendar.js"></script><script data-pjax>function gitcalendar_injector_config(){document.getElementById("recent-posts").insertAdjacentHTML("afterbegin",'<div class="recent-post-item" id="gitcalendarBar" style="width:100%;height:auto;padding:10px;"><style>#git_container{min-height: 280px}@media screen and (max-width:650px) {#git_container{min-height: 0px}}</style><div id="git_loading" style="width:10%;height:100%;margin:0 auto;display: block;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="#d0d0d0" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animatetransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animatetransform></path></svg><style>#git_container{display: none;}</style></div><div id="git_container"></div></div>'),console.log("已挂载gitcalendar")}document.getElementById("recent-posts")&&"/"===location.pathname&&(gitcalendar_injector_config(),GitCalendarInit("https://github-calendar.xmwpro.com/api?Cyan-Xmw",["#e3f2fd","#bbdefb","#90caf9","#64b5f6","#42a5f5","#2196f3","#1e88e5","#1976d2","#1565c0","#0d47a1","#425AEF"],"Cyan-Xmw"))</script></body></html>